package cn.codeforfun.initialization.server.annotation;

import cn.codeforfun.initialization.server.annotation.impl.UniqueHostValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author wangbin
 */
@Constraint(validatedBy = UniqueHostValidator.class)
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface UniqueHost {

    String message() default "IP地址已经存在!";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
